package com.duoduo.nacos.member.config;


import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @program: duoduo-nacos
 * @description: 用户接口
 * @author: 拾光！
 * @create: 2021-06-20 09:33
 */
@Configuration
public class RestConfig {


    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
        //此处是用的拦截器。如果让我实现的话，我应该会用spring的后置处理器
//        RestTemplate restTemplate = new RestTemplate();
//        restTemplate.setInterceptors(Collections.singletonList(new LoadBalancerInterceptor(loadBalancer)));
//        return restTemplate;
    }
    
    
}
